unit uGWCommonLog;

interface

uses
  SysUtils, Windows, uDZSysUtils;

procedure SendMessageToDebugger(msg: string);
procedure SendMessageToDebuggerA(msg: AnsiString);
procedure SendMessageToDebuggerW(msg: WideString);
procedure SendExceptionToDebugger(const func: string; ExptObj: Exception);

implementation

procedure SendMessageToDebugger(msg: string);
begin
  OutputDebugString(PChar(msg));
end;

procedure SendMessageToDebuggerA(msg: AnsiString);
begin
  OutputDebugStringA(PAnsiChar(msg));
end;

procedure SendMessageToDebuggerW(msg: WideString);
begin
  OutputDebugStringW(PWideChar(msg));
end;

procedure SendExceptionToDebugger(const func: string; ExptObj: Exception);
begin
  with ExptObj do
    SendMessageToDebugger(Format('%s %s: "%s"', [func, ClassName, Message]));
end;

end.
